local wdtx__peach_skill = fk.CreateSkill {
  name = "wdtx__peach_skill",
}

wdtx__peach_skill:addEffect("cardskill", {
  name = "wdtx__peach_skill",
  prompt = "#wdtx__peach_skill",
  mod_target_filter = function(self, to_select)
    return to_select:isWounded() and
      not table.find(Fk:currentRoom().alive_players, function(p)
        return p.dying
      end)
  end,
  can_use = function(self, player, card)
    return player:isWounded() and not player:isProhibited(player, card)
  end,
  on_use = function(self, room, use)
    if not use.tos or #use.tos == 0 then
      use.tos = { use.from }
    end
  end,
  on_effect = function(self, room, effect)
    local player = effect.from
    local target = effect.to
    local extra_add = 0
    if room.logic.class.name == "wdtx_logic" then 
      extra_add = effect.card:getMark("@up_recover")
    end
    if target:isWounded() and not target.dead then
      room:recover({
        who = target,
        num = 1+extra_add,
        card = effect.card,
        recoverBy = player,
        skillName = wdtx__peach_skill.name
      })
    end
  end
})


return wdtx__peach_skill